Fix "Suspicious comparison of Integer references" As reported by FindBugs: This method compares two reference values using the == or != operator, where the correct way to compare instances of this type is generally with the equals() method. It is possible to create distinct instances that are equal but do not compare as == since they are different objects. Examples of classes which should generally not be compared by reference are java.lang.Integer, java.lang.Float, etc. Change-Id: Ic976cc752314ff3ff6788530488fd00b0a6bb848
diff --git a/src/main/java/com/google/gerrit/plugins/ShowRepoAccessCommand.java b/src/main/java/com/google/gerrit/plugins/ShowRepoAccessCommand.java index cdf325b..4cc51a9 100644 --- a/src/main/java/com/google/gerrit/plugins/ShowRepoAccessCommand.java +++ b/src/main/java/com/google/gerrit/plugins/ShowRepoAccessCommand.java
@@ -84,7 +84,7 @@ stdout .print(String.format(ruleNameFormatter, permission.getName())); stdout.print(String.format(permissionNameFormatter, - (rule.getMin() != rule.getMax()) ? "" + rule.getMin() + " " + (!rule.getMin().equals(rule.getMax())) ? "" + rule.getMin() + " " + rule.getMax() : rule.getAction(), (permission.getExclusiveGroup() ? "EXCLUSIVE" : ""), format(rule.getGroup().getName())));
diff --git a/src/main/java/com/google/gerrit/plugins/ShowRepoAccountAccessCommand.java b/src/main/java/com/google/gerrit/plugins/ShowRepoAccountAccessCommand.java index cf2caeb..5dac238 100644 --- a/src/main/java/com/google/gerrit/plugins/ShowRepoAccountAccessCommand.java +++ b/src/main/java/com/google/gerrit/plugins/ShowRepoAccountAccessCommand.java
@@ -148,7 +148,7 @@ if (groupHash.contains(rule.getGroup().getName())) { sb.append(String.format(ruleNameFormatter, permission.getName())); sb.append(String.format(permissionNameFormatter, - (rule.getMin() != rule.getMax()) ? "" + rule.getMin() + " " + (!rule.getMin().equals(rule.getMax())) ? "" + rule.getMin() + " " + rule.getMax() : rule.getAction(), (permission.getExclusiveGroup() ? "EXCLUSIVE" : ""), format(rule.getGroup().getName())));